package org.example.singleton;

public class DoubleCheckSingleton {

    private static DoubleCheckSingleton instance=null;

    private DoubleCheckSingleton(){}

    public static DoubleCheckSingleton getInstance(){
        if (null == instance){
            synchronized (DoubleCheckSingleton.class){
                if (null == instance){
                    instance=new DoubleCheckSingleton();
                }

            }
        }
        return instance;
    }
}
